package com.nlscan.ncomgateway.core.sdk.http

import com.nlscan.ncomgateway.core.common.AppConst
import com.nlscan.ncomgateway.core.newland.entity.NlsIpCommand
import retrofit2.http.*

interface HttpOutputApi {

    //fix:Retrofit2网络请求的path部分的“/”斜杠乱码为“%2F”
    //处理：@Path 中增加 encoded = true
    @GET("{${AppConst.REQUEST_PATH_PARAM}}")
    suspend fun sendScanDataByGet(
        @Path(value = AppConst.REQUEST_PATH_PARAM, encoded = true) requestPathParam: String,
        @QueryMap queryMap: Map<String, String>
    ) : NlsIpCommand

    @POST("{${AppConst.REQUEST_PATH_PARAM}}")
    @FormUrlEncoded
    suspend fun sendScanDataByPost(
        @Path(value = AppConst.REQUEST_PATH_PARAM, encoded = true) requestPathParam: String,
        @FieldMap queryMap: Map<String, String>
    ): NlsIpCommand

    /**
     * 获取首页置顶文章列表
     * http://www.wanandroid.com/article/top/json
     */
//    @GET("article/top/json")
//    suspend fun getTopArticles()

}